//
//  PromtViewController+Request.m
//  NaRiLSVMT
//
//  Created by zhangmeng on 14-9-2.
//  Copyright (c) 2014年 helloyouth.org. All rights reserved.
//

#import "PromtViewController+Request.h"
#import "Network_Operation.h"
#import "UIImageView+AFNetworking.h"
#import "MBProgressController.h"
@implementation PromtViewController (Request)

-(void)getThumbDetail
{
    WeakSelf;
    dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
        NSString *getScreenStr = [Network_API Network_API_GetScreen];
        AFHTTPClient *httpClient = [Network_Operation httpClientWithUrl:getScreenStr];
        //        NSString *str = [NSString stringWithFormat:@"{\"classname\":%@,\"methodname\":%@,\"parameterClasss\":[%@]}",@"\"iControlSolutionService\"",@"\"getScreenForPad\"",[NSString stringWithFormat:@"{\"parametername\":%@,\"parametervalue\":%@,\"valuetype\":%@}",@"\"userId\"",@"\"2c90a5ec434677eb0143469080650003\"",@"\"java.lang.String\""]];
        
        NSDictionary *dic = @{
                              @"classname":@"iControlSolutionService",
                              @"methodname":@"getTemplateInfo",
                              @"parameterClasss":@[@{
                                                       @"parametername" :@"screenId",
                                                       @"parametervalue":self.screenId,
                                                           @"valuetype":@"java.lang.String"},
                                                   @{
                                                       @"parametername" :@"templateId",
                                                       @"parametervalue":self.templeted,
                                                       @"valuetype":@"java.lang.String"
                                                       }
                                                   ]
                              };
        
        [httpClient postPath:getScreenStr parameters:@{@"jsonstr":[Common dictoJson:dic],
                                                       @"callback":@""
                                                       }
                     success:^(AFHTTPRequestOperation *operation, id responseObject) {
                         NSLog(@"success");
                        NSArray *arr = [Common jsontoArr:responseObject];
                         NSDictionary *dic = arr[0];
                         wself.demData = dic[@"info"];
                         [self setDetailLabdata:wself.demData];
                     }
                     failure:^(AFHTTPRequestOperation *operation, NSError *error) {
                         [[MBProgressController sharedInstance] hide];
                         dispatch_async(dispatch_get_main_queue(), ^{
                             [[MBProgressController sharedInstance] hide];
                             [[MBProgressController sharedInstance] showTipsOnlyText:@"获取画面信息失败!" AndDelay:1.5];
                         });
                         NSLog(@"file");
                     }];
        
    });//
    
    
}

@end
